%
'#######################################
' EDIT THESE LINES - INIZIO MODIFICA
'#######################################
'############ MySQL Server Settings ############
' MySQL server IP address or Host Name (xxx.xxx.xxx.xxx/localhost)
Dim MySQLSVR : MySQLSVR = "mysql53.secureserver.net"
' MySQL server port(default 3306)
Dim MySQLPRT : MySQLPRT = 3306
' MySQL server username
Dim MySQLUID : MySQLUID = "freshbet"
' MySQL server password
Dim MySQLPWD : MySQLPWD = "nordlac"
' MySQL server database name
Dim MySQLDB : MySQLDB = "freshbet"
' MyODBC optional value
Dim MySQLOPT : MySQLOPT = 16386
'Set up the database table name prefix
' This is useful if you are running multiple blog from one database
Dim Table_Prefix : Table_Prefix = ""
'Set up the blog cookie and session name
'This is useful if you run multiple copies of Ublog Reload on the same site so that cookies don't interfer with each other
Dim Cookie_Name : Cookie_Name = "UG"
' Blog URL: for example, "http://www.yourdomain.com/blog/"
'*** remember final slash! ***
Dim Ublog_address : Ublog_address = "http://www.freshbetbits.com/"
' general upload folder ( make sure that this folder have sufficient permissions to write )
Dim folder_upload : folder_upload = "public"
' virtual path of the images upload folder
'*** remember final slash! ***
Dim StrPathShortImage : StrPathShortImage = folder_upload & "/images_upload/"
' build image upload folder path
'*** remember final slash! ***
Dim Dir_Image_Upload : Dir_Image_Upload = "http://www.freshbetbits.com/public/images_upload/"
' virtual path of the files upload folder
'*** remember final slash! ***
Dim StrPathShortFile : StrPathShortFile = folder_upload & "/files_upload/"
' build file upload folder path
'*** remember final slash! ***
Dim Dir_File_Upload : Dir_File_Upload = "http://www.freshbetbits.com/public/files_upload/"
' kind of image file allowed to upload
Dim imageuploadext : imageuploadext = "jpg,gif,bmp,png"
' max size allowed for each uploaded images
Dim imageuploadsize : imageuploadsize = 100000 ' 100 kb -'50000 ' 50 kb
' kind of file allowed to upload
Dim fileuploadext : fileuploadext = "doc,pdf,txt"
' max size allowed for each uploaded files
Dim fileuploadsize : fileuploadsize = 100000 ' 100 kb
' virtual path of box folder
Dim root_box_folder : root_box_folder = folder_upload & "/box"
' kind of file editable in File management
Dim arrEditable : arrEditable = Array("html", "htm", "asp", "inc", "shtml", "txt", "php", "xml", "aspx", "pl", "vb", "cs", "js", "vbs", "css")
' number of pages per block
Dim PagesPerBlock : PagesPerBlock = 10
'#######################################
' FINE MODIFICA - END OF EDIT
'#######################################
%>
<%
Dim timeStart, timeEnd
timeStart = Timer()
Dim adoCon
Dim strCon
Dim strSQL
Dim rsconfiguration
Dim Ublogname ' Ublog title
Dim emailamministratore ' administrator email address
Dim blnEmail ' verify if the notify via email to the administrator is activated
Dim strEmailComponent ' Email Component
Dim strSmtpServer ' SMTP Mail Server
Dim intRecordsPerPage ' number of blogs per page
Dim blnCookieSet ' anti-spam setting ( COOKIES )
Dim Time_difference ' if you're not on the timezone of your server
Dim Ublogtype ' kind of weblog: "open" or "closed"
Dim Ubloglanguage ' language chosen
Dim maxchar ' max number of characters allowed for each message
Dim blnLogin ' verify if the login is required for the publication of new blog in OPEN mode
Dim blnUpImage ' verify if the images upload is allowed
Dim blnUpFile ' verify if the files upload is allowed
Dim blnSmile ' verify if the emoticon smilies are allowed
Dim blntrack ' verify if the trackback is allowed
Dim Ublog_background
Dim Ublog_color1
Dim Ublog_color2
Dim Ublog_color3
Dim Ublog_font
Dim Ublog_size
Dim Ublog_font_colour
Dim Ublog_layout
Dim Ublog_Meta_Des
Dim Ublog_Meta_Key
Dim Ublog_Web_Refresh
Dim UblogReloadVersion
Dim UblogDate
Dim UblogHour
Dim Ublog_Email_Format
Dim strLineBreak
Dim UblogSMTPUsername
Dim UblogSMTPPassword
UblogReloadVersion = "Ublog Reload 1.0.5"
Set adoCon = Server.CreateObject("ADODB.Connection")
strCon = "Driver={MySQL ODBC 3.51 Driver};server="&MySQLSVR&";port="&MySQLPRT&";uid="&MySQLUID&";pwd="&MySQLPWD&";database="&MySQLDB&";option="&MySQLOPT&""
'strCon = "Driver={MySQL};server="&MySQLSVR&";port="&MySQLPRT&";uid="&MySQLUID&";pwd="&MySQLPWD&";database="&MySQLDB&";option="&MySQLOPT&""
adoCon.Open strCon
Set rsconfiguration = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM " & Table_Prefix & "config;"
rsconfiguration.CursorType = 3
rsconfiguration.Open strSQL, adoCon
If NOT rsconfiguration.EOF Then
Ublogname = rsconfiguration("nomeblog")
Ublog_Meta_Des = rsconfiguration("meta_des")
Ublog_Meta_Key = rsconfiguration("meta_key")
emailamministratore = rsconfiguration("email_address")
blnEmail = CBool(rsconfiguration("email_notify"))
strEmailComponent = rsconfiguration("email_component")
strSmtpServer = rsconfiguration("smtp_server")
intRecordsPerPage = rsconfiguration("n_record")
blnCookieSet = CBool(rsconfiguration("cookie"))
Time_difference = rsconfiguration("timedifference")*3600
Ublogtype = rsconfiguration("tipologia")
Ubloglanguage = rsconfiguration("language")
maxchar = rsconfiguration("maxchar")
blnLogin = CBool(rsconfiguration("login"))
blnUpImage = CBool(rsconfiguration("up_image"))
blnUpFile = CBool(rsconfiguration("up_file"))
blnSmile = CBool(rsconfiguration("smile"))
blntrack = CBool(rsconfiguration("track"))
Ublog_background = rsconfiguration("background")
Ublog_color1 = rsconfiguration("colour_base1")
Ublog_color2 = rsconfiguration("colour_base2")
Ublog_color3 = rsconfiguration("colour_base3")
Ublog_font = rsconfiguration("font")
Ublog_size = rsconfiguration("size")
Ublog_font_colour = rsconfiguration("font_colour")
Ublog_Web_Refresh = rsconfiguration("refreshweb")
UblogDate = rsconfiguration("dateformat")
UblogHour = rsconfiguration("hourformat")
Ublog_layout = rsconfiguration("layout")
Ublog_Email_Format = rsconfiguration("emailformat")
UblogSMTPUsername = rsconfiguration("smtp_server_user")
UblogSMTPPassword = rsconfiguration("smtp_server_pass")
End If
rsconfiguration.Close
Set rsconfiguration = Nothing
If Ublog_Email_Format = "HTML" Then
strLineBreak = " "
Else
strLineBreak = VbCrLf
End If
'Load the language data
Execute(GetFileContents(Server.MapPath("language/" & Ubloglanguage & ".inc")))
Dim bLoggedIn
bLoggedIn = (Len(Session(Cookie_Name & "UblogUsername")) > 0)
'Attempt to retrieve the login data from cookies
If Not bLoggedIn Then
Session(Cookie_Name & "UblogUsername") = Decrypt(Request.Cookies(Cookie_Name & "UblogR")("Username"))
Session(Cookie_Name & "UblogEmail") = Decrypt(Request.Cookies(Cookie_Name & "UblogR")("Email"))
Session(Cookie_Name & "UblogLevel") = Decrypt(Request.Cookies(Cookie_Name & "UblogR")("Level"))
bLoggedIn = (Len(Session(Cookie_Name & "UblogUsername")) > 0)
End If
%>
<%
'******************************************
'*** Cookies & password Encryption *****
'******************************************
Const ENCKEY = "UblogReload1.0.4"
Function Encrypt(Stringa)
Encrypt = Binary2StringaHex(EncryptStringa(Stringa, ENCKEY))
End Function
Function Decrypt(Stringa)
Decrypt = Trim(EncryptStringa(StringaHex2Binary(Stringa), ENCKEY))
End Function
Function EncryptStringa(Stringa, Chiave)
lChiave = 0
For p = 1 to Len(Chiave)
lChiave = lChiave + Asc(Mid(Chiave,p,1))
Next
Rnd (-1 * lChiave)
Buffer = ""
For p = 1 To Len(Stringa)
c = Asc(Mid(Stringa, p, 1)) - 32
c1 = (c Xor (Int(Rnd() * 64))) + 32
Buffer = Buffer & Chr(c1)
Next
EncryptStringa = Buffer
End Function
Function Binary2StringaHex(Stringa)
Buffer = ""
For k = 1 To Len(Stringa)
Buffer = Buffer + HexValue(Asc(Mid(Stringa, k, 1)), 2)
Next
Binary2StringaHex = Buffer
End Function
Function HexValue(valore, Cifre)
HexValue = Right(String(Cifre, "0") + Hex(valore), Cifre)
End Function
Function StringaHex2Binary(Stringa)
Buffer = ""
For k = 1 To Len(Stringa) Step 2
HexVal = "&H" + Mid(Stringa, k, 2)
Buffer = Buffer + Chr(cint(HexVal))
Next
StringaHex2Binary = Buffer
End Function
Function IIf(bCheck, sTrue, sFalse)
If bCheck Then IIf = sTrue Else IIf = sFalse
End Function
Function GetFileContents(FilePath)
Dim FSO
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
If FSO.FileExists(FilePath) Then
GetFileContents = FSO.OpenTextFile(FilePath, 1).ReadAll
Else
GetFileContents = Null
End If
End Function
'Check a variable isn't "empty"
Function IsBlank(byref TempVar)
'by default, assume it's not blank
IsBlank = False
'now check by variable type
select case VarType(TempVar)
'Empty & Null
case 0, 1
IsBlank = True
'String
case 8
if Len(TempVar) = 0 then
IsBlank = True
end if
'Object
case 9
tmpType = TypeName(TempVar)
If (tmpType = "Nothing") Or (tmpType = "Empty") Then
IsBlank = True
End If
'Array
case 8192, 8204, 8209
'does it have at least one element?
if UBound(TempVar) = -1 then
IsBlank = True
end if
end select
end function
'******************************************
%>
<%
'*****************************
'*** Category Function *****
'*****************************
Private Function ListCat(strID, strIndents, strFormat)
Dim rs_cat_parent
Dim strIndentString
If strFormat = "AdminList" Or strFormat = "CategoryViewList" Then
strSQL = "SELECT " & Table_Prefix & "category.cat_id,cat_name,cat_parent,cat_des,COUNT(" & Table_Prefix & "blog.blog_id) "_
& "AS cat_count FROM " & Table_Prefix & "category LEFT JOIN " & Table_Prefix & "blog2cat ON (" & Table_Prefix & "category.cat_id = " & Table_Prefix & "blog2cat.cat_id) "_
& "LEFT JOIN " & Table_Prefix & "blog ON (" & Table_Prefix & "blog.blog_id = " & Table_Prefix & "blog2cat.blog_id) WHERE cat_parent = " & strID & " " _
& "GROUP BY " & Table_Prefix & "category.cat_id,cat_name,cat_parent,cat_des ORDER BY cat_name;"
Else
strSQL = "SELECT cat_id,cat_name,cat_parent FROM " & Table_Prefix & "category WHERE cat_parent = " & strID & " ORDER BY cat_name;"
End If
Set rs_cat_parent = adoCon.Execute(strSQL)
Do Until rs_cat_parent.EOF
If strFormat = "CategoryViewList" Then
strIndentSubString = " "
strIndentString = strIndentSubString
For count = 1 To strIndents
strIndentString = strIndentString & strIndentSubString
Next
Else
strIndentSubString = "— "
strIndentString = strIndentSubString
For count = 1 To strIndents
strIndentString = strIndentString & strIndentSubString
Next
End If
If strFormat = "AdminList" Then
Response.Write VbCrLf & "
<% End Sub %>
<%
'************** POLL **************
Sub Poll()
%>
<% = UCase(strLangSelectPoll) %>
<%
Dim blnAlreadyVoted
Dim TotalVotes
Dim rs_poll
Dim VotePercent
blnAlreadyVoted = False
TotalVotes = 0
Set rs_poll = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM " & Table_Prefix & "polls ORDER BY " & Table_Prefix & "polls.id DESC LIMIT 1;"
rs_poll.CursorType = 2
rs_poll.LockType = 3
rs_poll.Open strSQL, strCon
If rs_poll.EOF Then
Response.Write "
" & strLangErrorMessageNoPolls & "
"
Else
For k = 1 To 7
TotalVotes = TotalVotes + CInt(rs_poll("Votes_" & k & ""))
Next
If CInt(Request.Cookies(Cookie_Name & "Ublog")("PollId")) = CInt(rs_poll("id")) Then blnAlreadyVoted = True
%>
<% End If %>
<%
rs_poll.Close : Set rs_poll = Nothing
End Sub
%>
<%
'************** SEARCH **************
Sub Search()
%>
<% = UCase(strLangSelectSearchBlog) %>
<% End Sub %>
<%
'************** RECENT ENTRIES **************
Sub Recent()
%>
<% = UCase(strLangSelectRecentBlog) %>
<%
Dim rs_blog_entries, Top
Top = 8
strSQL = "SELECT blog_titolo,blog_id FROM " & Table_Prefix & "blog ORDER BY blog_id DESC LIMIT " & Top & ";"
Set rs_blog_entries = adoCon.Execute(strSQL)
If rs_blog_entries.EOF Then
Response.Write "
<% End Sub %>
<%
'************** WEBCAM **************
Sub Webcam()
%>
<% = UCase(strLangSelectWebcam) %>
<%
Dim WebcamF, WebcamFs, ImageLastModify, ValueReal, SecondToday, SecondLast, SecondDiff
Set WebcamFs = Server.CreateObject("Scripting.FileSystemObject")
If WebcamFs.FileExists(Server.MapPath("images/webcamlive.jpg")) Then
Set WebcamF = WebcamFs.GetFile(Server.MapPath("images/webcamlive.jpg"))
ImageLastModify = WebcamF.DateLastModified
End If
Set WebcamFs = Nothing
ValueReal = (Ublog_Web_Refresh/1000) + 50
SecondToday = DatePart("s",Now()) + (DatePart("n",Now())*60)
SecondLast = DatePart("s",ImageLastModify) + (DatePart("n",ImageLastModify)*60)
SecondDiff = Abs(SecondToday - SecondLast)
If FormatDateTime(Now(),2) = FormatDateTime(ImageLastModify,2) And DatePart("h",Now()) = DatePart("h",ImageLastModify) Then
If SecondDiff > ValueReal Then
Response.Write("")
Else
Response.Write("")
Response.Write("")
End If
Else
Response.Write("")
End If
%>
<% End Sub %>
<%
'************** BLOGGERS **************
Sub Bloggers()
%>
<% = UCase(strLangSelectBloggersBlog) %>
<%
Set rs_blogger = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT id,username,COUNT(" & Table_Prefix & "blog.blog_id) "_
& "AS userblog_count FROM " & Table_Prefix & "users LEFT JOIN " & Table_Prefix & "blog ON " & Table_Prefix & "users.username = " & Table_Prefix & "blog.blog_autore "_
& "GROUP BY id,username ORDER BY username;"
rs_blogger.Open strSQL, strCon, 1, 3
While Not rs_blogger.Eof
%>